# Run a short five chain version to check convergence speed.  Thin at
# the same rate as the full run, giving 2000 draws instead of 5000.

# Paper model
library(uds)
data(democracy1946.2000)
data.uds <- prepare.uds(democracy)

print(Sys.time())
post.uds <- mroprobit(data=data.uds, 
                      sigma.mh=c(0.015, 0.065, 0.022, 0.006, 0.043,
                      0.044, 0.0025, 0.024, 0.012, 0.01),
                      save.traits = TRUE, save.perceived.traits =
                      TRUE, mcmc = 200000, burnin = 0, thin =
                      100, verbose = 100000, seed = 3333, chains=5,
                      disperse=T)
print(Sys.time())
save(post.uds, file="post.uds.5chain.RData")
rm(list=ls()) # free up some RAM

# The 12-measure model
#library(uds)
#data(democracy1946.2008)
#data.uds <- prepare.uds(democracy, include.extra=T)
#
#print(Sys.time())
#post.uds <- mroprobit(data=data.uds, 
#                      sigma.mh=c(0.015, 0.065, 0.022, 0.006, 0.043,
#                      0.044, 0.0025, 0.024, 0.012, 0.008, 0.055, 0.03),
#                      save.traits = TRUE, save.perceived.traits =
#                      TRUE, mcmc = 200000, burnin = 0, thin =
#                      200, verbose = 100000, seed = 3333, chains=5,
#                      disperse=T)
#print(Sys.time())
#save(post.uds, file="post.uds.5chain.RData")
#rm(list=ls()) # free up some RAM
